<?php
namespace App\Json;
/**
 * Created by PhpStorm.
 * User: Han
 * Date: 2016/12/27
 * Time: 13:56
 */
class Json
{
    public static  function json($code,$message='',$data = array(),$extra=array()){
        if(!is_numeric($code)){
            return ;
        }
        $extra_img = array(
            'img'=>$extra
        );
        $head = array('code'=>(int)$code,
            'messages'=>$message,'result'=>$data,'extra_img'=>$extra_img);
        echo json_encode($head,JSON_UNESCAPED_UNICODE);
        exit;
    }
}